Optimal. Leaf size=59 \[ \frac {\text {ArcTan}\left (\frac {\sqrt {a-b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )}{(a-b)^{3/2}}-\frac {\cot (x)}{(a-b) \sqrt {a+b \cot ^2(x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.235, Rules used = {3751, 482, 385,
209} \begin {gather*} \frac {\text {ArcTan}\left (\frac {\sqrt {a-b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )}{(a-b)^{3/2}}-\frac {\cot (x)}{(a-b) \sqrt {a+b \cot ^2(x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 385
Rule 482
Rule 3751
Rubi steps
\begin {align*} \int \frac {\cot ^2(x)}{\left (a+b \cot ^2(x)\right )^{3/2}} \, dx &=-\text {Subst}\left (\int \frac {x^2}{\left (1+x^2\right ) \left (a+b x^2\right )^{3/2}} \, dx,x,\cot (x)\right )\\ &=-\frac {\cot (x)}{(a-b) \sqrt {a+b \cot ^2(x)}}+\frac {\text {Subst}\left (\int \frac {1}{\left (1+x^2\right ) \sqrt {a+b x^2}} \, dx,x,\cot (x)\right )}{a-b}\\ &=-\frac {\cot (x)}{(a-b) \sqrt {a+b \cot ^2(x)}}+\frac {\text {Subst}\left (\int \frac {1}{1-(-a+b) x^2} \, dx,x,\frac {\cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )}{a-b}\\ &=\frac {\tan ^{-1}\left (\frac {\sqrt {a-b} \cot (x)}{\sqrt {a+b \cot ^2(x)}}\right )}{(a-b)^{3/2}}-\frac {\cot (x)}{(a-b) \sqrt {a+b \cot ^2(x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(137\) vs. \(2(59)=118\).
time = 0.75, size = 137, normalized size = 2.32 \begin {gather*} \frac {(-a+b) \cot (x) \sqrt {1+\frac {b \cot ^2(x)}{a}}+\frac {1}{2} \tanh ^{-1}\left (\frac {\sqrt {-\frac {(a-b) \cot ^2(x)}{a}}}{\sqrt {1+\frac {b \cot ^2(x)}{a}}}\right ) (-a-b+(a-b) \cos (2 x)) \sqrt {-\frac {(a-b) \cot ^2(x)}{a}} \csc (x) \sec (x)}{(a-b)^2 \sqrt {a+b \cot ^2(x)} \sqrt {1+\frac {b \cot ^2(x)}{a}}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.15, size = 99, normalized size = 1.68
method | result | size |
derivativedivides | \(-\frac {\cot \left (x \right )}{a \sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}}-\frac {b \cot \left (x \right )}{\left (a -b \right ) a \sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}}+\frac {\sqrt {b^{4} \left (a -b \right )}\, \arctan \left (\frac {b^{2} \left (a -b \right ) \cot \left (x \right )}{\sqrt {b^{4} \left (a -b \right )}\, \sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}}\right )}{\left (a -b \right )^{2} b^{2}}\) | \(99\) |
default | \(-\frac {\cot \left (x \right )}{a \sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}}-\frac {b \cot \left (x \right )}{\left (a -b \right ) a \sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}}+\frac {\sqrt {b^{4} \left (a -b \right )}\, \arctan \left (\frac {b^{2} \left (a -b \right ) \cot \left (x \right )}{\sqrt {b^{4} \left (a -b \right )}\, \sqrt {a +b \left (\cot ^{2}\left (x \right )\right )}}\right )}{\left (a -b \right )^{2} b^{2}}\) | \(99\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 173 vs.
\(2 (51) = 102\).
time = 4.06, size = 388, normalized size = 6.58 \begin {gather*} \left [-\frac {{\left ({\left (a - b\right )} \cos \left (2 \, x\right ) - a - b\right )} \sqrt {-a + b} \log \left (-2 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (2 \, x\right )^{2} - 2 \, {\left ({\left (a - b\right )} \cos \left (2 \, x\right ) - b\right )} \sqrt {-a + b} \sqrt {\frac {{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}{\cos \left (2 \, x\right ) - 1}} \sin \left (2 \, x\right ) + a^{2} - 2 \, b^{2} + 4 \, {\left (a b - b^{2}\right )} \cos \left (2 \, x\right )\right ) + 4 \, {\left (a - b\right )} \sqrt {\frac {{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}{\cos \left (2 \, x\right ) - 1}} \sin \left (2 \, x\right )}{4 \, {\left (a^{3} - a^{2} b - a b^{2} + b^{3} - {\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} \cos \left (2 \, x\right )\right )}}, -\frac {{\left ({\left (a - b\right )} \cos \left (2 \, x\right ) - a - b\right )} \sqrt {a - b} \arctan \left (-\frac {\sqrt {a - b} \sqrt {\frac {{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}{\cos \left (2 \, x\right ) - 1}} \sin \left (2 \, x\right )}{{\left (a - b\right )} \cos \left (2 \, x\right ) - b}\right ) + 2 \, {\left (a - b\right )} \sqrt {\frac {{\left (a - b\right )} \cos \left (2 \, x\right ) - a - b}{\cos \left (2 \, x\right ) - 1}} \sin \left (2 \, x\right )}{2 \, {\left (a^{3} - a^{2} b - a b^{2} + b^{3} - {\left (a^{3} - 3 \, a^{2} b + 3 \, a b^{2} - b^{3}\right )} \cos \left (2 \, x\right )\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\cot ^{2}{\left (x \right )}}{\left (a + b \cot ^{2}{\left (x \right )}\right )^{\frac {3}{2}}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 161 vs.
\(2 (51) = 102\).
time = 0.50, size = 161, normalized size = 2.73 \begin {gather*} -\frac {{\left (\sqrt {-a + b} \sqrt {b} \log \left ({\left | -\sqrt {-a + b} + \sqrt {b} \right |}\right ) - a + b\right )} \mathrm {sgn}\left (\sin \left (x\right )\right )}{a^{2} \sqrt {b} - 2 \, a b^{\frac {3}{2}} + b^{\frac {5}{2}}} + \frac {\frac {\sqrt {-a + b} \log \left ({\left | -\sqrt {-a + b} \cos \left (x\right ) + \sqrt {-a \cos \left (x\right )^{2} + b \cos \left (x\right )^{2} + a} \right |}\right )}{a^{2} - 2 \, a b + b^{2}} + \frac {\sqrt {-a \cos \left (x\right )^{2} + b \cos \left (x\right )^{2} + a} \cos \left (x\right )}{{\left (a \cos \left (x\right )^{2} - b \cos \left (x\right )^{2} - a\right )} {\left (a - b\right )}}}{\mathrm {sgn}\left (\sin \left (x\right )\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \int \frac {{\mathrm {cot}\left (x\right )}^2}{{\left (b\,{\mathrm {cot}\left (x\right )}^2+a\right )}^{3/2}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________